const webpack=require('webpack');
const config=require('./webpack.config.build');
const fs=require('fs-extra');
const path=require('path');


fs.removeSync(path.resolve(__dirname,'../dist'));
console.log('删除了',path.resolve(__dirname,'../dist'));
webpack(config,function(err,stats){
    if (err) throw err
    console.log("构建完了，复制下静态资源");
    fs.copySync(path.resolve(__dirname,'../static'),path.resolve(__dirname,'../dist/static'));
    console.log("静态资源也复制完了，就这么泡吧地结束了")
})